function Vue(data) {
    this.parent = Array.prototype.splice.call(arguments, 1)[0] || 'data';
    this.data = data;
    this.walk(data);
}

var p = Vue.prototype;

p.walk = function (obj) {
    var key,
        val;
    for(key in obj){
        if(obj.hasOwnProperty(key)){
            val = obj[key];
            if(typeof val === 'object'){
                new Vue(val,this.parent+'.'+key)
            }
            this.conver(key,val,this.parent)
        }
    }
}

p.conver = function(key,val,parent){
    Object.defineProperty(this.data,key,{
        enumerable:true,
        
        configurable:true,
        get:function(){
            console.log('你访问了'+key)
            return val
        },
        set:function(newval){
            console.log('你设置了'+key+'新值为'+newval);
            val = newval;
        }
    })
}

